s1 = {'game', 'music', 'TV'}
s2 = {'song', 'shopping', 'TV'}
s3 = {'music', 'game'}

lst = [{'name': '小明', 'hobby': s1},
       {"name":'小红', 'hobby':s2},
       {'name': '小刚', 'hobby': s3}
       ]
for i in range(len(lst)):
    for j in range(i+1,len(lst)):
        if lst[i].get('hobby')& lst[j].get('hobby'):
            print(f"{lst[i]['name']}和{lst[j]['name']}会成为好朋友")
